Sets the playback rate (1 = normal, 2 = double speed, 0.5 = half speed...) of s’s own currently-playing instance - same "no-op if not tracked" rule as sound_pan.
sound_speed(s, speed)| Name | Type |
|---|---|
s | sound |
speed | real |
Nothing.
Sets the playback rate (1 = normal, 2 = double speed, 0.5 = half speed...) of s's own currently-playing instance - same "no-op if not currently tracked" rule as sound_pan, and the same "call it right after sound_play in the same event" answer for setting it at play time.
This is both speed and pitch at once - the one knob a one-shot sound effect has. Changing how fast it plays changes how high or low it sounds too; there is no way to change one without the other for a sound effect on this hardware. Compare music_pitch/music_tempo, which genuinely are independent knobs for music.
sound_play(snd_doc_beep, 1);
sound_speed(snd_doc_beep, 1.5);Plays the beep 50% faster and a fifth or so higher in pitch, together - a cheap way to give a repeated sound effect (a footstep, a pickup) a little variety by picking a random speed each time instead of always sounding identical.
This is BOTH speed and pitch at once - the one knob a one-shot sound effect has. Changing how fast it plays changes how high or low it sounds too; there is no way to change one without the other for a sound effect on this hardware (compare music_pitch/music_tempo, which genuinely are independent for music).